<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<?xml version="1.0" charset="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

<html>
  <head>
    <title>Inventario</title>
  </head>
  <body>
    
    <u>Consulta Inventario</u><br/>
    <a href="OrderServlet?action=<%=request.getParameter("return")%>">Volver</a>
    <table border="1" cellpadding="0">
      <tr>
        <td><b>Producto</b></td>
        <td><b>Stock (CA)</b></td>
      </tr>
      <c:forEach var="product" items="${requestScope.inventory}">
        <c:choose>
          <c:when test="${product.id!=null}">
            <tr>
              <td>${product.description}</td>
              <!--<tdfmt:formatNumber value="${product.stock/product.conversionRate}" pattern="#,##0.00"/></td>-->
              <td><fmt:formatNumber value="${product.stock}" pattern="#,##0.00"/></td>
            </tr>
          </c:when>
          <c:otherwise>
            <tr>
              <td colspan="0">
                <font color="#0000FF">${product.description}</font>
              </td>
            </tr>
          </c:otherwise>
        </c:choose>
      </c:forEach>
    </table>
    <br/>
    <a href="OrderServlet?action=<%=request.getParameter("return")%>">Volver</a>
  </body>
</html>
